<?php
	if(isset($_GET['id'])) {
		session_start();
		$cart = $_SESSION['cart'];
		if(!$cart) {
			$_SESSION['cart'] = array();
		} else {
			foreach($cart as $item) {
				if($item == $_GET['id']) {
					header('Location:index.php');
					exit();
				}
			}
		}
		$_SESSION['cart'][] = array($_GET['id'], 1);
	}
	header('Location:index.php');
?>